package com.clever.mall.service.impl;

import com.clever.mall.entity.Activity;
import com.clever.mall.mapper.ActivityMapper;
import com.clever.mall.service.ActivityService;
import com.clever.mall.utils.MyBeanUtils;
import com.clever.mall.vo.ActivityVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ActivityServiceImpl implements ActivityService {
    @Resource
    ActivityMapper activityMapper;

    @Override
    //查询所有要展示的活动图片
    public List<ActivityVo> findALl() {
        List<Activity> activities = activityMapper.selectAll();
        List<ActivityVo> activityVos = MyBeanUtils.copyListProperties(activities, ActivityVo::new);
        return activityVos;
    }
}
